<?php
require_once ("../src/db/connectdatabase.php");
require_once ("../src/entitys/ApplyLoan.php");

function insertApplyLoan($data) {
	$con = new ConnectDB();
	
	$tbl = "applyloans";
	$fn = array('aplly_id' => ($data -> getID()), 'loan_id' => ($data -> getLoan()), 'loan_name' => ($data -> getNameLoan()), 'fullname' => ($data -> getName()), 'dayofbirth' => ($data -> getBirthday()), 'country' => ($data -> getCity()), 'phone_number' => ($data -> getPhone()), 'email' => ($data -> getEmail()), 'profession' => ($data -> getProfesion()), 'tongluong' => ($data -> getSumsalary()), 'amount_loans' => ($data -> getAmountloan()), 'giatritaisan' => ($data -> getGiatritaisan()), 'monthloan' => ($data -> getMonthloan()), 'datecreate' => ($data -> getDatecreate()));
	return $con -> insert($tbl, $fn);
}
?>